package com.citygis.transferdata.api.source1.controller;

import com.alibaba.fastjson.JSONObject;
import com.citygis.transferdata.api.source1.service.MasterService;
import com.citygis.transferdata.config.resultBody.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName: MasterController 
 * @Description: TODO
 * @author: liuzg
 * @Date: 2021/8/31 9:57
 * @Version: v1.0
 */
@RestController
@RequestMapping(value = "/sourceOne")
@Api(tags = "主数据源-数据同步")
public class MasterController {

    @Resource
    private MasterService service;

    @GetMapping(value = "/getlist")
    @ApiOperation(value = "获取数据列表")
    public ResultBody getList() {
        List<JSONObject> list = service.getList();
        return ResultBody.success(list);
    }

    @GetMapping(value = "/pushData")
    @ApiOperation(value = "同步数据")
    public ResultBody pushData() {
        return service.processData();
    }

    @GetMapping(value = "/pushMediaData")
    @ApiOperation(value = "同步数据媒体")
    public ResultBody pushMediaData() {
        return service.processMediaData();
    }



    public void Test(){

    }
}
